//utils.js
var music={
		//因为这个音效听起来是de的声音，所以我取这个函数名，方便记忆音效，找的合适的场景就能想起来。
		play_didi(){
				let innerAudioContext = uni.createInnerAudioContext();
				innerAudioContext.autoplay = true;
				innerAudioContext.src = 'static/mp3/tixing.mp3';
				innerAudioContext.onPlay(() => {
			  		// console.log('开始播放');
				});
				innerAudioContext.onError((res) => {
					// console.log('播放错误');
				 //  	console.log(res.errMsg);
				 //  	console.log(res.errCode);
				});
				setTimeout(()=>{
					if (innerAudioContext) {
						// console.log('销毁音乐');
					  try {
						  // console.log('ttttt');
					    innerAudioContext.pause();
					    innerAudioContext.destroy()
					    innerAudioContext = null
					  } catch (e) {
						  console.log('ee',e);
					    //TODO handle the exception
					  }
					}
				},1000)
				
				

		},
		
		
}

module.exports = music;
